<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Description: 
  User: wangguichun
  Date: 2018/4/14
  Time: 19:30
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>话题列表</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/base.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/nav.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/mask.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/topicDetail.css?acx">
</head>
<body>
<jsp:include page="../common/nav.jsp"/>
<div class="main">
    <div class="content">
        <div class="head">
            <img src="${topic.image}">
            <div>
                <h3 id="topicId">${topic.name}</h3>
            </div>
        </div>
        <div class="body">
            <ul>
                <c:forEach items="${pageInfo.list}" var="question">
                <li>
                    <div class="item">
                        <h4>
                            <a href="${pageContext.request.contextPath}/ques/${question.id}">${question.title}</a>
                        </h4>
                        <a href="${pageContext.request.contextPath}/ques/${question.id}">查看回答</a>
                        <a href="${pageContext.request.contextPath}/ques/${question.id}"><span> • </span>提问于 <span class="timeNeedConvert">${question.time}</span></a>
                    </div>
                </li>
                </c:forEach>
            </ul>
        </div>
        <%--分页--%>
        <div id="pagination"></div>
    </div>
    <div class="sidebar">
        <%--右侧栏--%>
        <jsp:include page="../common/sidebar.jsp"/>
        <jsp:include page="../common/footer.jsp"/>

    </div>
</div>
<jsp:include page="../common/mask.jsp"/>


</body>

<script src="${pageContext.request.contextPath}/js/myPagination.js"></script>
<script src="${pageContext.request.contextPath}/js/MyConverter.js"></script>
<script>

    $(function () {
        var div = $("#pagination");
        var curPage = ${pageInfo.pageNum};
        var allPage = ${pageInfo.pages};
        var length = 5;
        paginationConstructor(div, length, curPage, allPage);
    });

</script>
</html>
